<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:88:"D:\phpstudy\PHPTutorial\WWW\fastadmin\public/../application/admin\view\store\detail.html";i:1543977242;s:80:"D:\phpstudy\PHPTutorial\WWW\fastadmin\application\admin\view\layout\default.html";i:1540985180;s:77:"D:\phpstudy\PHPTutorial\WWW\fastadmin\application\admin\view\common\meta.html";i:1540985180;s:79:"D:\phpstudy\PHPTutorial\WWW\fastadmin\application\admin\view\common\script.html";i:1540985180;}*/ ?>
<!DOCTYPE html>
<html lang="<?php echo $config['language']; ?>">
    <head>
        <meta charset="utf-8">
<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">

<link rel="shortcut icon" href="/assets/img/favicon.ico" />
<!-- Loading Bootstrap -->
<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/assets/js/html5shiv.js"></script>
  <script src="/assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
    var require = {
        config:  <?php echo json_encode($config); ?>
    };
</script>
    </head>

    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
        <div id="main" role="main">
            <div class="tab-content tab-addtabs">
                <div id="content">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <section class="content-header hide">
                                <h1>
                                    <?php echo __('Dashboard'); ?>
                                    <small><?php echo __('Control panel'); ?></small>
                                </h1>
                            </section>
                            <?php if(!IS_DIALOG && !$config['fastadmin']['multiplenav']): ?>
                            <!-- RIBBON -->
                            <div id="ribbon">
                                <ol class="breadcrumb pull-left">
                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
                                </ol>
                                <ol class="breadcrumb pull-right">
                                    <?php foreach($breadcrumb as $vo): ?>
                                    <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
                                    <?php endforeach; ?>
                                </ol>
                            </div>
                            <!-- END RIBBON -->
                            <?php endif; ?>
                            <div class="content">
                                <form id="add-form" class="form-horizontal  nice-validator n-default n-bootstrap"  data-toggle="validator" method="POST" action="<?php echo url('store/editPost'); ?>" >

    <div class="form-group">
        <label for="store_name" class="control-label col-xs-12 col-sm-2">店铺名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="store_name" id="store_name" class="form-control" value="<?php echo $info['store_name']; ?>">
        </div>
    </div>
    <input type="hidden" name="id" value="<?php echo $info['id']; ?>">
    <div class="form-group">
        <label for="address" class="control-label col-xs-12 col-sm-2">店铺地址:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="address" id="address" class="form-control"  value="<?php echo $info['address']; ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="address" class="control-label col-xs-12 col-sm-2">店铺电话:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="mobile" id="mobile" class="form-control"  value="<?php echo $info['mobile']; ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="mav" class="control-label col-xs-12 col-sm-2">店铺介绍:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="mav" id="mav" class="form-control"  value="<?php echo $info['mav']; ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="price" class="control-label col-xs-12 col-sm-2">价格(分钟):</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="price" id="price" class="form-control"  value="<?php echo $info['price']; ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="s_time" class="control-label col-xs-12 col-sm-2">收费开始(24小时制):</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="s_time" id="s_time" class="form-control"  value="<?php echo $info['s_time']; ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="e_time" class="control-label col-xs-12 col-sm-2">收费开始(24小时制):</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="e_time" id="e_time" class="form-control"  value="<?php echo $info['e_time']; ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="level" class="control-label col-xs-12 col-sm-2">店铺级别:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="level" >
                <?php if(is_array($level) || $level instanceof \think\Collection || $level instanceof \think\Paginator): if( count($level)==0 ) : echo "" ;else: foreach($level as $key=>$vo): if($vo['id'] == $info['level']): ?>
                <option value="<?php echo $vo['id']; ?>" selected><?php echo $vo['name']; ?></option>
                <?php else: ?>
                <option value="<?php echo $vo['id']; ?>" ><?php echo $vo['name']; ?></option>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="cat_store" class="control-label col-xs-12 col-sm-2">店铺类别:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="cat_store" >
                <?php if(is_array($classify) || $classify instanceof \think\Collection || $classify instanceof \think\Paginator): if( count($classify)==0 ) : echo "" ;else: foreach($classify as $key=>$vo): if($vo['id'] == $info['cat_store']): ?>
                <option value="<?php echo $vo['id']; ?>" selected><?php echo $vo['name']; ?></option>
                <?php else: ?>
                <option value="<?php echo $vo['id']; ?>"><?php echo $vo['name']; ?></option>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="provinceid" class="control-label col-xs-12 col-sm-2">省:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="provinceid" id="provinceid">
                <?php if(is_array($provinces) || $provinces instanceof \think\Collection || $provinces instanceof \think\Paginator): if( count($provinces)==0 ) : echo "" ;else: foreach($provinces as $key=>$vo): if($vo['provinceid'] == $info['provinceid']): ?>
                <option value="<?php echo $vo['provinceid']; ?>" selected><?php echo $vo['province']; ?></option>
                <?php else: ?>
                <option value="<?php echo $vo['provinceid']; ?>"><?php echo $vo['province']; ?></option>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="cityid" class="control-label col-xs-12 col-sm-2">市:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="cityid" id="cityid" >
                <?php if(is_array($city) || $city instanceof \think\Collection || $city instanceof \think\Paginator): if( count($city)==0 ) : echo "" ;else: foreach($city as $key=>$vo): if($vo['cityid'] == $info['cityid']): ?>
                <option value="<?php echo $vo['cityid']; ?>" selected><?php echo $vo['city']; ?></option>
                <?php else: ?>
                <option value="<?php echo $vo['cityid']; ?>"><?php echo $vo['city']; ?></option>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="areaid" class="control-label col-xs-12 col-sm-2">县:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="areaid" id="areaid" >
                <?php if(is_array($areas) || $areas instanceof \think\Collection || $areas instanceof \think\Paginator): if( count($areas)==0 ) : echo "" ;else: foreach($areas as $key=>$vo): if($vo['areaid'] == $info['areaid']): ?>
                <option value="<?php echo $vo['areaid']; ?>" selected><?php echo $vo['area']; ?></option>
                <?php else: ?>
                <option value="<?php echo $vo['areaid']; ?>"><?php echo $vo['area']; ?></option>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="uname" class="control-label col-xs-12 col-sm-2">内容:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea name="content"  class="form-control"><?php echo $info['content']; ?></textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="uname" class="control-label col-xs-12 col-sm-2">课程:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea name="course"  class="form-control"><?php echo $info['course']; ?></textarea>
        </div>
    </div>
   <!-- <div class="form-group">
        <label for="uname" class="control-label col-xs-12 col-sm-2">相册:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="file" id="file" name="file" accept="image/*">
            <input type="file" id="file1" name="file1" accept="image/*">
            <input type="file" id="file2" name="file2" accept="image/*">
        </div>
        <input type="hidden" id="img" name="img" value="">
        <input type="hidden" id="img1" name="img1" value="">
        <input type="hidden" id="img2" name="img2" value="">
    </div>-->
    <div class="form-group layer-footer">
        <div class="col-xs-2"></div>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">提交</button>
        </div>
    </div>
</form>
<script type="text/javascript" src="/assets/js/jquery-1.9.1.min.js"></script>
<!-- 实例化编辑器 -->
<link rel='stylesheet' href='/assets/editor/themes/default/default.css' />
<link rel='stylesheet' href='/assets/editor/plugins/code/prettify.css'/>
<script language='javascript' src='/assets/editor/kindeditor.js'></script>
<script language='javascript' src='/assets/editor/lang/zh_CN.js'></script>
<script language='javascript' src='/assets/editor/plugins/code/prettify.js'></script>
<script>
    var editor;
    KindEditor.ready(function(K) {
        editor = K.create('textarea[name=content]',{

            uploadJson : '/assets/editor/php/upload_json.php',
            fileManagerJson : '/assets/editor/php/file_manager_json.php',

            allowFileManager : true,
            afterBlur: function(){editor.sync();}

        });

    });
    var course;
    KindEditor.ready(function(K) {
        course = K.create('textarea[name=course]',{

            uploadJson : '/assets/editor/php/upload_json.php',
            fileManagerJson : '/assets/editor/php/file_manager_json.php',

            allowFileManager : true,
            afterBlur: function(){course.sync();}

        });

    });
    /*图片上传*/
    $("#file").on("change",function(){
        var formData = new FormData();
        formData.append('file', this.files[0]);
        $.ajax({
            url: "<?php echo url('store/img'); ?>",
            type: 'POST',
            data: formData,
            cache: false,
            processData: false,
            contentType: false
        }).done(function(res) {
            if(res.msg.num == 1)
            {
                $('#img').val(res.msg.con);
            }else{
                alert(res.msg.con);
            }
            /*  var sr='<img id="img" style="width: 100%;height: 100%" src="//upload/upload/'+res.msg.con+'"/>'
             $('.img-up-box').html(sr);
             $('#name').val(res.msg.con);*/
        }).fail(function(res) {});
    });
    $("#file1").on("change",function(){
        var formData = new FormData();
        formData.append('file', this.files[0]);
        $.ajax({
            url: "<?php echo url('store/img'); ?>",
            type: 'POST',
            data: formData,
            cache: false,
            processData: false,
            contentType: false
        }).done(function(res) {
            if(res.msg.num == 1)
            {
                $('#img1').val(res.msg.con);
            }else{
                alert(res.msg.con);
            }
            /*  var sr='<img id="img" style="width: 100%;height: 100%" src="//upload/upload/'+res.msg.con+'"/>'
             $('.img-up-box').html(sr);
             $('#name').val(res.msg.con);*/
        }).fail(function(res) {});
    });
    $("#file2").on("change",function(){
        var formData = new FormData();
        formData.append('file', this.files[0]);
        $.ajax({
            url: "<?php echo url('store/img'); ?>",
            type: 'POST',
            data: formData,
            cache: false,
            processData: false,
            contentType: false
        }).done(function(res) {
            if(res.msg.num == 1)
            {
                $('#img2').val(res.msg.con);
            }else{
                alert(res.msg.con);
            }
            /*  var sr='<img id="img" style="width: 100%;height: 100%" src="//upload/upload/'+res.msg.con+'"/>'
             $('.img-up-box').html(sr);
             $('#name').val(res.msg.con);*/
        }).fail(function(res) {});
    });
    /*三级联动*/
    $('#provinceid').change(function () {
        var provinces=$('#provinceid option:selected').val();
        $.post("<?php echo url('store/city'); ?>",{provinces:provinces},function (date) {
            var con="";
            $.each(date.msg,function(k,v){
                con +='<option value='+v.cityid+' >'+v.city+'</option>'
                $('#cityid').html(con);
            })
        })
    })
    $('#cityid').change(function(){
        var city=$('#cityid option:selected').val();
        if(city==0)
        {
            alert("请选择市级单位");
            return false;
        }
        $.post("<?php echo url('store/areas'); ?>",{city:city},function (date) {
            var con="";
            $.each(date.msg,function(k,v){
                con +='<option value='+v.areaid+' >'+v.area+'</option>'
                $('#areaid').html(con);
            })
        })
    })
</script>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo $site['version']; ?>"></script>
    </body>
</html>